﻿<%@ Page Language="VB" MasterPageFile="~/HelpDesk.master" AutoEventWireup="false"
    CodeFile="ProjetsForm.aspx.vb" Inherits="Admin_ProjetsForm" Title="Projets" Theme="HelpDesk"
    Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:SqlDataSource ID="SqlProjet" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskCS %>"
        DeleteCommand="DELETE FROM [Projet] WHERE [projet_id] = @projet_id" InsertCommand="INSERT INTO [Projet] ([projet_nom], [projet_resume], [projet_support], [projet_url], [entreprise_id], [etatprojet_id]) VALUES (@projet_nom, @projet_resume, @projet_support, @projet_url, @entreprise_id, @etatprojet_id)"
        SelectCommand="SELECT [projet_id], [projet_nom], [projet_resume], [projet_support], [projet_url], [entreprise_id], [etatprojet_id] FROM [Projet] WHERE ([projet_id] = @projet_id)"
        UpdateCommand="UPDATE [Projet] SET [projet_nom] = @projet_nom, [projet_resume] = @projet_resume, [projet_support] = @projet_support, [projet_url] = @projet_url, [entreprise_id] = @entreprise_id, [etatprojet_id] = @etatprojet_id WHERE [projet_id] = @projet_id">
        <DeleteParameters>
            <asp:Parameter Name="projet_id" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="projet_nom" Type="String" />
            <asp:Parameter Name="projet_resume" Type="String" />
            <asp:Parameter Name="projet_support" Type="String" />
            <asp:Parameter Name="projet_url" Type="String" />
            <asp:Parameter Name="entreprise_id" Type="Int32" />
            <asp:Parameter Name="etatprojet_id" Type="Int32" />
            <asp:Parameter Name="projet_id" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
            <asp:QueryStringParameter Name="projet_id" QueryStringField="projet_id" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="projet_nom" Type="String" />
            <asp:Parameter Name="projet_resume" Type="String" />
            <asp:Parameter Name="projet_support" Type="String" />
            <asp:Parameter Name="projet_url" Type="String" />
            <asp:Parameter Name="entreprise_id" Type="Int32" />
            <asp:Parameter Name="etatprojet_id" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:FormView ID="FormViewProjet" runat="server" DataKeyNames="projet_id" DataSourceID="SqlProjet"
        DefaultMode="Insert" meta:resourcekey="FormViewProjetResource1">
        <EditItemTemplate>
            <h1>
                <asp:Literal ID="Literal1" runat="server" meta:resourcekey="Literal1Resource1" Text="Editer un projet"></asp:Literal>
            </h1>
            <p>
                <label>
                    <asp:Literal ID="Literal2" runat="server" meta:resourcekey="Literal2Resource1" Text="<%$ Resources:Projects, ProjectName %>"></asp:Literal>
                </label>
                <asp:TextBox ID="projet_nomTextBox" runat="server" Text='<%# Bind("projet_nom") %>'
                    Columns="50" meta:resourcekey="projet_nomTextBoxResource1"></asp:TextBox>
            </p>
            <p>
                <label>
                    <asp:Literal ID="Literal3" runat="server" meta:resourcekey="Literal3Resource1" Text="<%$ Resources:Projects, ProjectClient %>"></asp:Literal>
                </label>
                <asp:SqlDataSource ID="SqlClient" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskCS %>"
                    SelectCommand="SELECT [entreprise_id], [entreprise_nom] FROM [Entreprise] ORDER BY [entreprise_nom]">
                </asp:SqlDataSource>
                <asp:DropDownList ID="DropDownListClient" runat="server" DataSourceID="SqlClient"
                    DataTextField="entreprise_nom" DataValueField="entreprise_id" SelectedValue='<%# Bind("entreprise_id") %>'
                    meta:resourcekey="DropDownListClientResource1">
                </asp:DropDownList>
            </p>
            <p>
                <label>
                    <asp:Literal ID="Literal4" runat="server" meta:resourcekey="Literal4Resource1" Text="<%$ Resources:Projects, ProjectSummary %>"></asp:Literal>
                </label>
                <asp:TextBox ID="projet_resumeTextBox" runat="server" Text='<%# Bind("projet_resume") %>'
                    TextMode="MultiLine" Columns="50" Rows="5" meta:resourcekey="projet_resumeTextBoxResource1"></asp:TextBox>
            </p>
            <p>
                <label>
                    <asp:Literal ID="Literal5" runat="server" meta:resourcekey="Literal5Resource1" Text="<%$ Resources:Projects, ProjectSupport %>"></asp:Literal>
                </label>
                <asp:TextBox ID="projet_supportTextBox" runat="server" Text='<%# Bind("projet_support") %>'
                    Columns="20" meta:resourcekey="projet_supportTextBoxResource1"></asp:TextBox>
                <asp:Literal ID="Literal6" runat="server" meta:resourcekey="Literal6Resource1" Text="<%$ Resources:Projects, ProjectSupportDetails %>"></asp:Literal>
            </p>
            <p>
                <label>
                    <asp:Literal ID="Literal7" runat="server" meta:resourcekey="Literal7Resource1" Text="<%$ Resources:Projects, ProjectURL %>"></asp:Literal>
                </label>
                <asp:TextBox ID="projet_urlTextBox" runat="server" Text='<%# Bind("projet_url") %>'
                    Columns="50" meta:resourcekey="projet_urlTextBoxResource1"></asp:TextBox>
            </p>
            <p>
                <label>
                    <asp:Literal ID="Literal8" runat="server" meta:resourcekey="Literal8Resource1" Text="<%$ Resources:Projects, ProjectState %>"></asp:Literal>
                </label>
                <asp:SqlDataSource ID="SqlEtat" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskCS %>"
                    SelectCommand="SELECT [etatprojet_id], [etatprojet_label] FROM [EtatProjet] ORDER BY [etatprojet_ordre]">
                </asp:SqlDataSource>
                <asp:DropDownList ID="DropDownListEtat" runat="server" DataSourceID="SqlEtat" DataTextField="etatprojet_label"
                    DataValueField="etatprojet_id" SelectedValue='<%# Bind("etatprojet_id") %>' meta:resourcekey="DropDownListEtatResource1">
                </asp:DropDownList>
            </p>
            <p>
                <label>
                    &nbsp;</label>
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="<%$ Resources:WebResource, ButtonSave %>"
                    meta:resourcekey="UpdateButtonResource1"></asp:Button>
                <asp:HyperLink ID="UpdateCancelButton" runat="server" Text="<%$ Resources:WebResource, ButtonCancel %>"
                    NavigateUrl="~/Admin/Projets.aspx" meta:resourcekey="UpdateCancelButtonResource1"></asp:HyperLink>
            </p>
            <p align="right">
                <asp:LinkButton runat="server" ID="DeleteButton" CommandName="Delete" OnClientClick="return confirm('Voulez-vous vraiment supprimer ce projet ?')"
                    meta:resourcekey="DeleteButtonResource1" Text="<%$ Resources:WebResource, ButtonDelete %>"></asp:LinkButton>
            </p>
        </EditItemTemplate>
        <InsertItemTemplate>
            <h1>
                <asp:Literal ID="Literal11" runat="server" meta:resourcekey="Literal11Resource1"
                    Text="Nouveau projet"></asp:Literal>
            </h1>
            <p>
                <label>
                    <asp:Literal ID="Literal12" runat="server" meta:resourcekey="Literal12Resource1"
                        Text="<%$ Resources:Projects, ProjectName %>"></asp:Literal>
                </label>
                <asp:TextBox ID="projet_nomTextBox" runat="server" Text='<%# Bind("projet_nom") %>'
                    Columns="50" meta:resourcekey="projet_nomTextBoxResource2"></asp:TextBox>
            </p>
            <p>
                <label>
                    <asp:Literal ID="Literal13" runat="server" meta:resourcekey="Literal13Resource1"
                        Text="<%$ Resources:Projects, ProjectClient %>"></asp:Literal>
                </label>
                <asp:SqlDataSource ID="SqlClient" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskCS %>"
                    SelectCommand="SELECT [entreprise_id], [entreprise_nom] FROM [Entreprise] ORDER BY [entreprise_nom]">
                </asp:SqlDataSource>
                <asp:DropDownList ID="DropDownListClient" runat="server" DataSourceID="SqlClient"
                    DataTextField="entreprise_nom" DataValueField="entreprise_id" SelectedValue='<%# Bind("entreprise_id") %>'
                    meta:resourcekey="DropDownListClientResource2">
                </asp:DropDownList>
            </p>
            <p>
                <label>
                    <asp:Literal ID="Literal14" runat="server" meta:resourcekey="Literal14Resource1"
                        Text="<%$ Resources:Projects, ProjectSummary %>"></asp:Literal>
                </label>
                <asp:TextBox ID="projet_resumeTextBox" runat="server" Text='<%# Bind("projet_resume") %>'
                    TextMode="MultiLine" Columns="50" Rows="5" meta:resourcekey="projet_resumeTextBoxResource2"></asp:TextBox>
            </p>
            <p>
                <label>
                    <asp:Literal ID="Literal15" runat="server" meta:resourcekey="Literal15Resource1"
                        Text="<%$ Resources:Projects, ProjectSupport %>"></asp:Literal>
                </label>
                <asp:TextBox ID="projet_supportTextBox" runat="server" Text='<%# Bind("projet_support") %>'
                    Columns="20" meta:resourcekey="projet_supportTextBoxResource2"></asp:TextBox>
                <asp:Literal ID="Literal16" runat="server" meta:resourcekey="Literal16Resource1"
                    Text="<%$ Resources:Projects, ProjectSupportDetails %>"></asp:Literal>
            </p>
            <p>
                <label>
                    <asp:Literal ID="Literal17" runat="server" meta:resourcekey="Literal17Resource1"
                        Text="<%$ Resources:Projects, ProjectURL %>"></asp:Literal>
                </label>
                <asp:TextBox ID="projet_urlTextBox" runat="server" Text='<%# Bind("projet_url") %>'
                    Columns="50" meta:resourcekey="projet_urlTextBoxResource2"></asp:TextBox>
            </p>
            <p>
                <label>
                    <asp:Literal ID="Literal18" runat="server" meta:resourcekey="Literal18Resource1"
                        Text="<%$ Resources:Projects, ProjectState %>"></asp:Literal>
                </label>
                <asp:SqlDataSource ID="SqlEtat" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskCS %>"
                    SelectCommand="SELECT [etatprojet_id], [etatprojet_label] FROM [EtatProjet] ORDER BY [etatprojet_ordre]">
                </asp:SqlDataSource>
                <asp:DropDownList ID="DropDownListEtat" runat="server" DataSourceID="SqlEtat" DataTextField="etatprojet_label"
                    DataValueField="etatprojet_id" SelectedValue='<%# Bind("etatprojet_id") %>' meta:resourcekey="DropDownListEtatResource2">
                </asp:DropDownList>
            </p>
            <p>
                <label>
                    &nbsp;</label>
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="<%$ Resources:WebResource, ButtonSave %>"
                    meta:resourcekey="InsertButtonResource1"></asp:Button>
                <asp:HyperLink ID="InsertCancelButton" runat="server" Text="<%$ Resources:WebResource, ButtonCancel %>"
                    NavigateUrl="~/Admin/Projets.aspx" meta:resourcekey="InsertCancelButtonResource1"></asp:HyperLink>
            </p>
        </InsertItemTemplate>
    </asp:FormView>
</asp:Content>
